package cn.lds.healthexamspringboot.mapper;

import cn.lds.healthexamspringboot.domain.User;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author christopher
 * @since 2025-02-14
 */
public interface UserMapper extends BaseMapper<User> {

    default User loginUser(User user){

        QueryWrapper<User> userQueryWrapper = new QueryWrapper<User>()
                .eq("mobile_no",user.getMobileNo())
                .eq("password",user.getPassword());

        User loginUser = this.selectOne(userQueryWrapper);

        return loginUser;

    }

}
